#===============================================================================
# Makefile for CBT++ libraries using STLPort version of STL. 
#
#------------------------------------------------------------------------------
# K. James Durbin    					
#===============================================================================
# $Id: $
#------------------------------------------------------------------------------

INCLUDES_STLPORT = -I/home/hgsc/include/hgsc.compbio/stlport $(INCLUDES_CC)


#=============================================================================
# Object files. 
#=============================================================================
# Build lists of object files from the targets. 

# Keep optimized, debug, and profile objects separate. 
# g and pg specify debug and debug+profile respectively.
stlportobjs = $(libtargets:%=$(CBT_OBJ)/%.stlport.o)
faststlportobjs =$(libtargets:%=$(CBT_OBJ)/%.faststlport.o)

stlport: $(CBT_LIB)/libcbt.stlport.a

faststlport: $(CBT_LIB)/libcbt.faststlport.a

# Compile STLPort based version.  
# _STLP_DEBUG enables STLPort debugging mode, with safe iterators and so on. 
# This is the main reason to use STLPort on most platforms. 
# STLPort exceeds the default template depth maximum of 17, so that is bumped up here. 
$(CBT_OBJ)/%.stlport.o: $(CBT_SRC)/%.cc 
	$(GCC) -g -ftemplate-depth-250 -D_STLP_DEBUG $(CCFLAGSSTLPORT) $(INCLUDES_STLPORT) -c -o $(CBT_OBJ)/$*.stlport.o $(CBT_SRC)/$*.cc


$(CBT_OBJ)/%.faststlport.o: $(CBT_SRC)/%.cc 
	$(GCC) -O3 -ftemplate-depth-250 -D_STLP $(CCFLAGSFASTSTLPORT) $(INCLUDES_STLPORT) -c -o $(CBT_OBJ)/$*.faststlport.o $(CBT_SRC)/$*.cc


# Make library based on stlport.
$(CBT_LIB)/libcbt.stlport.a: $(stlportobjs)
	ar rc  $@  $(stlportobj)

# Make library based on stlport.
$(CBT_LIB)/libcbt.faststlport.a: $(faststlportobjs)
	ar rc  $@  $(faststlportobj)
